import request from '@/utils/request'

function getTables () {
  return request({
    url: '/gen/tables',
    method: 'get'
  })
}

function getColumns (param) {
  return request({
    url: '/gen/columns',
    method: 'get',
    params: {
      tableName: param
    }
  })
}

function getTypes () {
  return request({
    url: '/gen/types',
    method: 'get'
  })
}

function generator (params) {
  return request({
    url: '/gen/gen',
    method: 'post',
    data: {
      ...params
    }
  })
}

export {
  getTables,
  getColumns,
  getTypes,
  generator
}
